package com.ssy.lingxi.member.merchant.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 会员审批状态枚举
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-29
 */
public enum MemberValidateAgreeEnum {

    /**
     * 同意 - 1
     */
    AGREE(1, "同意"),

    /**
     * 不同意 - 0
     */
    DISAGREE(0, "不同意");

    private final Integer code;

    MemberValidateAgreeEnum(int code, String message) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.getCode());
    }

    public static MemberValidateAgreeEnum parse(Integer code) {
        return Arrays.stream(MemberValidateAgreeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
